MediaSetHandlerCapabilities
TheMediaSetHandlerCapabilities
function allows your derived media handler to report its capabilities to the base media handler.
pascal ComponentResult MediaSetHandlerCapabilities (ComponentInstance ci, long flags, long flagsMask);
ci
- Identifies your derived media handler's connection to the base media handler.
flags
- Specifies the capabilities of your derived media handler. This parameter contains a number of flags, each of which corresponds to a particular feature. You may work with more than one flag at a time. The following flags are defined (be sure to set unused flags to 0):
handlerHasSpatial
Indicates that your handler does spatial processing. If you set this flag to 1, the Movie Toolbox informs your derived media handler about changes to the graphics environment or spatial representation of your media.handlerCanClip
Indicates that your media handler can perform clipping. If you set this flag to 1, the Movie Toolbox calls yourMediaSetClip
function (described on page 10-32) whenever the clipping region changes.handlerCanMatte
Reserved for Apple. Do not set this flag to 1.handlerCanTransferMode
- Indicates that you can work with transfer modes other than source copy or dither copy. If you set this flag to 1, the Movie Toolbox calls your
MediaGetTrackOpaque
function to determine whether your track is transparent.handlerNeedsBuffer
- Indicates that your media handler needs help during playback. If you set this flag to 1, the base media handler allocates an offscreen buffer and handles all display transformations for you.
handlerNoIdle
Indicates that your derived media handler does not need any processing time during playback. If you set this flag
to 1, the Movie Toolbox never calls yourMediaIdle
function. This is useful for media handlers that store data in a media, but do not play that data.handlerNoScheduler
- Indicates that your media handler performs special processing during playback. Normally, the Movie Toolbox calls your
MediaIdle
function only when it is time for your handler to draw data from a new media sample.
If you set this flag to 1, the Movie Toolbox calls that function other times as well, so that your media handler can prepare for playback or perform other necessary processing.handlerWantsTime
Indicates that your media handler needs additional processing time. If you set this flag to 1, the Movie Toolbox calls yourMediaIdle
function as often as possible.handlerCGrafPortOnly
- Indicates that your media handler can only draw into color graphics ports. If you set this flag to 1, the base media handler performs the necessary processing to display your color media on a black-and-white graphics port (this involves drawing to an offscreen buffer and then transferring the image to the screen).
flagsMask
- Indicates which flags in the
flags
parameter are to be considered in this operation. For each bit in theflags
parameter that you want the base media handler to consider, you must set the corresponding bit in theflagsMask
parameter to 1. Set unused flags to 0. This allows you to work with a single flag without altering the settings of other flags.DESCRIPTION
Use theMediaSetHandlerCapabilities
function to tell the base media handler what your derived media handler can do. By default, all of the flags are set to 0--in this case, your media handler is only responsible for storing and retrieving data. You can specify further capabilities by setting various flags to 1. For example, if your handler draws data on the screen, be sure to set thehandlerHasSpatial
flag to 1. Other flags govern more detailed aspects of handler operation.This function uses both a
flags
parameter and aflagsMask
parameter. You specify which flags are to be changed in a given operation by setting theflagsMask
parameter. You then specify the new values for those affected flags with theflags
parameter.
In this manner, you can work with a single flag without affecting the settings of any other flags.Your media handler may call this function at any time. In general, you should call it
from yourMediaInitialize
function (described on page 10-17), so that you report your capabilities to the base media handler before the Movie Toolbox starts working with your media. You may call this function again later, in response to changing conditions. For example, if your media handler receives a matrix that it cannot accommodate from theMediaSetMatrix
function, you can allow the base
media handler to handle your drawing by calling this function and setting thehandlerNeedsBuffer
flag in both theflags
andflagsMask
parameters to 1.Note that this function is provided by the base media handler--your media handler does not support this function.
RESULT CODES
Any Component Manager result code
Main | Top of Section | What's New | Apple Computer, Inc. | Find It | Feedback | Help